import React from 'react';
import BaseComponent from '../Base/BaseComponent';
import {Tag} from 'antd';

class MyTag extends BaseComponent {
    constructor(props) {
        super(props);
        this.state = {
            checked: props.checked
        }
    }

    componentWillReceiveProps(nextProps) {
        this.setState({checked: nextProps.checked});
    }

    render() {
        return (
            <div>
                <Tag.CheckableTag  {...this.props} checked={this.state.checked} onChange={this.props.onChange}/>
            </div>
        )
    }
}

export default MyTag;